package edu.yngsxy.communityservice.sys.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import edu.yngsxy.communityservice.core.model.entity.WkBaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
/**
 * <p>
 * 角色：存储系统角色
 * </p>
 *
 * @author lr
 * @since 2025-09-09
 */
@Getter
@Setter
@ToString
@TableName("sys_role")
@Accessors(chain = true)
@Schema(description = "角色：存储系统角色")
public class SysRole extends WkBaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 角色名称：是给人看的“管理员”
     */
    @TableField("name")
    @Schema(title = "角色名称", description = "是给人看的“管理员”", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "角色名称不能为空")
    @Size(max = 20, message = "角色名称长度不能超过20个字符")
    private String name;

    /**
     * 角色码：给电脑程序看的“admin”
     */
    @TableField("code")
    @Schema(title = "角色码", description = "给电脑程序看的“admin”", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "角色码不能为空")
    @Size(max = 20, message = "角色码长度不能超过20个字符")
    private String code;
}
